FROM kylin-server-10-sp2-x86:b09

# Maintainer
# --------------
MAINTAINER support  <support@bessystem.com>

# Environment variables required for this build
# ---------------------------------------------
ENV JAVA_HOME /usr/java/jdk8u312-b07
ENV BES_HOME /opt/bes/BES_STANDALONE
ENV PATH $JAVA_HOME/bin:$PATH
ENV TZ=Asia/Shanghai

# Basic support
#-----------------------------
RUN mkdir -p "$BES_HOME"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ>/etc/timezone
COPY pkgs/*.rpm /opt/bes/
RUN rpm -iv --replacepkgs /opt/bes/dejavu-fonts-common-2.33-6.el7.noarch.rpm
RUN rpm -iv --replacepkgs /opt/bes/dejavu-sans-fonts-2.33-6.el7.noarch.rpm
RUN rpm -iv --replacepkgs /opt/bes/libpng-1.5.13-8.el7.x86_64.rpm --force
RUN rpm -iv --replacepkgs /opt/bes/freetype-2.8-14.el7_9.1.x86_64.rpm
RUN rpm -iv --replacepkgs /opt/bes/fontconfig-2.13.0-4.3.el7.x86_64.rpm
RUN rpm -iv --replacepkgs /opt/bes/net-tools-2.0-0.24.20131004git.el7.x86_64.rpm

# Setup bes
#----------------------------------------------
ADD BES9.5.5.7266.009.T001.tar.gz $BES_HOME
ADD OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz /usr/java

# License and Patch
#----------------------------------------------
RUN rm -rf $BES_HOME/license/bes.lic.txt
EXPOSE 1900 6600 8080
WORKDIR $BES_HOME

ENTRYPOINT $BES_HOME/bin/iastool start --server --passport B#2008_2108#es --user admin --password B#2008_2108#es; tail -f $BES_HOME/logs/server.log
